def bubble_sort_var2(A):
    aissoarted = False
    n = len(A) - 1
    while n > 0 and not aissoarted:
        aissoarted = True
        for i in range(n):
            if A[i] > A[i + 1]:
                t = A[i]
                A[i] = A[i + A]
                A[i + 1] = t
                aissoarted = False
        n -= 1
